Using J2SE 5 ("Tiger") support with WebWork
To use J2SE 5 support with WebWork, you have to add xwork-tiger.jar to your classpath. Interceptor AnnotationsTo use these annotations, you have to specify the AnnotationWorkflowInterceptor to your interceptor stack.
Validation AnnotationsIf you want to use annotation based validation, you have to annotate the class or interface with Validation Annotation. These are the standard validator annotations that come with XWork-tiger:
Type Conversion AnnotationsIf the xwork-tigerjar is added to the classpath, you will directly have type conversion support for Maps and Collections using generics. In short, instead of specifying the types found in collections and maps as documented in Type Conversion, the collection's generic type is used. This means you most likely don't need any ClassName-conversion.properties files. If you want to use annotation based type conversion, you have to annotate the class or interface with the Conversion Annotation.
Create ClassName-conversion.properties via "ant apt" targetThis is an example for the apt ant target: <target name="apt"> <mkdir dir="${build}/generated"/> <path id="classpath"> <pathelement path="${basedir}/build/java"/> <pathelement path="${basedir}/build/test"/> <!-- xwork.jar and xwork-tiger.jar must be in one of the following lib dirs --> <fileset dir="${basedir}/lib/build" includes="*.jar"/> <fileset dir="${basedir}/lib/default" includes="*.jar"/> <fileset dir="${basedir}/lib/spring" includes="*.jar"/> </path> <property name="pclasspath" refid="classpath"/> <!-- Change the includes attribute value to match your annotated java files --> <fileset id="sources" dir="." includes="src/test/**/*.java" /> <pathconvert pathsep=" " property="sourcefiles" refid="sources"/> <echo> CLASSPATH ${pclasspath} SOURCES: ${sourcefiles} </echo> <exec executable="apt" > <arg value="-s"/> <arg value="${build}/generated"/> <arg value="-classpath"/> <arg pathref="classpath"/> <arg value="-nocompile"/> <arg value="-factory"/> <arg value="com.opensymphony.xwork.apt.XWorkProcessorFactory"/> <arg line="${sourcefiles}"/> </exec> </target> |